<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
	<% String path=request.getContextPath(); String basePath=request.getScheme() + "://" + request.getServerName() + ":"
		+ request.getServerPort() + path + "/" ; %>

		<!DOCTYPE html>
		<html>

		<head>
			<base href="<%=basePath%>">

			<title>企业档案表</title>

			<meta http-equiv="pragma" content="no-cache">
			<meta http-equiv="cache-control" content="no-cache">
			<meta http-equiv="expires" content="0">
			<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
			<meta http-equiv="description" content="This is my page">
			<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

		</head>

		<body>
			<%@ include file="/WEB-INF/jsp/common/headerSupply.jsp" %>
				<%@ include file="/WEB-INF/jsp/common/loadDiv.jsp" %>

					<script type="text/javascript">
						$(function () {
							init();
							initBank();
							// initBank1();
							// initBank2();
							loadCombotree();
							initCity();
							// bindgridSubject();
							// bindgridBank();

							$("#uploadbtn").bind("click", function (e) {
								$("#uploadpicker").click();
							});
						});

						function loadCombotree() {
							$('#comAdmit').combotree({
								url: 'sys/mm/type/selectTreeList',
								multiple: true,
								animate: true,
								onLoadSuccess: function () {
									$('#comAdmit').combotree('tree').tree("collapseAll");
								}
							});
						}

						function init() {
							$
								.ajax({
									type: "get",
									dataType: "json",
									url: 'supply/info/selectInfor?id=' + PUser.infId,
									// 				data : JSON.stringify(model),
									contentType: "application/json",
									success: function (data) {
										if (data.code != 60200) {
											$.messager.alert('消息', data.msg);
										} else {
											var json = data.data;
											var detail = json.bankModels;
											if (json.infAdmitLevel) {
												$('#comAdmit').combotree('setValues',
													json.infAdmitLevel.split(','));
											}
											$('#infId').textbox('setValue', json.infId);
											$('#oaStatus').textbox('setValue', json.oaStatus);
											$('#oaFlowId').textbox('setValue', json.oaFlowId);
											if (json.infApprovalStatus == 1) {
												switch (json.oaStatus) {
													case '1':
														$('#infStatus').textbox('setValue', '审批中')
														break;
													case '2':
														$('#infStatus').textbox('setValue', '审核通过')
														break;
													case '0':
														$('#infStatus').textbox('setValue', '审核不通过')
														break;
													default:
														$('#infStatus').textbox('setValue', '审批中')
												}
											} else {
												$('#infStatus').textbox('setValue', '待提交')
											}
											// $('#infStatus')
											// 	.textbox(
											// 		'setValue',
											// 		json.infApprovalStatus == 1 ? (json.oaStatus == 1 ? '审核中'
											// 			: '审核通过')
											// 			: '待提交');
											if (json.infApprovalStatus == 1
												&& !json.infCode) {
												$('#btnSave').linkbutton('disable');
												$('#btnCommit').linkbutton('disable');
											}
											if (json.oaStatus == '0') {
												$('#btnSave').linkbutton('enable');
												$('#btnCommit').linkbutton('enable');
											}
											$('#infCode').textbox('setValue', json.infCode);
											$('#infName').textbox('setValue', json.infName);
											$('#infMail').textbox('setValue', json.infMail);
											$('#infAddress').textbox('setValue',
												json.infAddress);
											$('#infCreditCode').textbox('setValue',
												json.infCreditCode);
											$('#infCountry').combobox('setValue',
												json.infCountryCode);
											$('#infProvince').combobox('setValue',
												json.infProvinceCode);
											$('#cobCondition').combobox('setValue',
												json.infConditionCode);
											if (json.infType) {
												$('#infType').combobox('setValue',
													json.infType);
												$('#infType').combobox('setText',
													json.infCatagory);
											}
											$('#infCity').combogrid('setValue', json.infArea);
											$('#infCity').combogrid('setText', json.infCity);
											$('#infAddress').textbox('setValue',
												json.infAddress);
											$('#infMobile').textbox('setValue',
												json.infMobile);
											$('#infMobile').textbox('setValue',
												json.infMobile);
											$('#infGroup').textbox('setValue',
												json.infGroupCode);
											$('#infExplain').textbox('setValue',
												json.infExplain);
											$('#infContactsName').textbox('setValue',
												json.infContactsName);
											$('#infLegalPerson').textbox('setValue',
												json.infLegalPerson);
											// if (detail.length > 0) {
											// 	initBank(detail[0].bakName);
											// 	$('#infBankName').combogrid('setValue',
											// 		detail[0].bakCode);
											// 	$('#infBankName').combogrid('setText',
											// 		detail[0].bakName);
											// 	$('#infBankAccount').textbox('setValue',
											// 		detail[0].bakOwnerName);
											// 	$('#infBankNumber').textbox('setValue',
											// 		detail[0].bakNum);
											// }
											$('#infTax').combobox('setText', json.infTax);
											console.log('json.infTax', json.infTax);
											$('#infTax').combobox('setValue',
												json.infTaxCode);
											getFileList(json.infId);
											bindgridSubject();
											bindgridBank();

										}
									},
									error: function (XMLHttpRequest, textStatus,
										errorThrown) {
										$.messager.alert('消息', errorThrown);
									}
								})
						}
					</script>
					<script>
						function commit() {
							$.messager.confirm('确认提示', '确认提交?', function (r) {
								if (r) {
									save('1');
								}
							})
						}

						function save(action) {
							if (!$('#fm').form('validate')) {
								$.messager.alert('提示', '请录入基本信息必填项');
								return;
							}
							var length = $('#comAdmit').combotree('getValues').join().length;
							if (length > 1000) {
								$.messager.alert('提示', '准入目录选择过多，请准确选择');
								return;
							}
							if (!checkComboGridValue('infCity', 'code')) {
								$.messager.alert('提示', '请选择正确地市!');
								return;
							}

							var banks = $('#ttBank').datagrid('getRows');
							if (!banks || banks.length == 0) {
								$.messager.alert('提示', '请录入银行信息');
								return;
							}
							if (!banks[0].bakOwnerName) {
								$.messager.alert('提示', '请录入账户名称');
								return;
							}

							var model = {
								infAdmitLevel: $('#comAdmit').combotree('getValues').join(),
								infId: $('#infId').textbox('getValue'),
								oaStatus: $('#oaStatus').textbox('getValue'),
								oaFlowId: $('#oaFlowId').textbox('getValue'),
								infCode: $('#infCode').textbox('getValue'),
								infName: $('#infName').textbox('getValue'),
								infCreditCode: $('#infCreditCode').textbox('getValue'),
								infCountryCode: $('#infCountry').combobox('getValue'),
								infLegalPerson: $('#infLegalPerson').textbox('getValue'),
								infCountry: $('#infCountry').combobox('getText'),
								infProvince: $('#infProvince').combobox('getText'),
								infProvinceCode: $('#infProvince').combobox('getValue'),
								infCity: $('#infCity').combogrid('getText'),
								infArea: $('#infCity').combogrid('getValue'),
								infAddress: $('#infAddress').textbox('getValue'),
								infMobile: $('#infMobile').textbox('getValue'),
								infContactsName: $('#infContactsName').textbox('getValue'),
								infTax: $('#infTax').combobox('getText'),
								infTaxCode: $('#infTax').combobox('getValue'),
								infBranchName: $('#infBankName').combogrid('getValue'),
								infBankName: $('#infBankName').combogrid('getText'),
								infBankAccount: $('#infBankAccount').textbox('getValue'),
								infBankNumber: $('#infBankNumber').textbox('getValue'),
								infCatagory: $('#infType').combobox('getText'),
								infType: $('#infType').combobox('getValue'),
								infConditionCode: $('#cobCondition').combobox('getValue'),
								infConditionName: $('#cobCondition').combobox('getText'),
								infGroupCode: $('#infGroup').textbox('getValue'),
								infExplain: $('#infExplain').textbox('getValue'),
								infMail: $('#infMail').textbox('getValue'),
								bankModels: banks,
								corpModels: Subject,
								infApprovalStatus: '0',
								status: '0'
							};
							if (action == '1') {
								var Subject = $('#ttSubject').datagrid('getRows');
								if (!Subject || Subject.length == 0) {
									$.messager.alert('提示', '请录入经营范围');
									return;
								}
								let choiseFile = $("#checkfileList>li");
								let yyzz = 0, wts = 0, sfz = 0;
								$.each(choiseFile, function (index1, item) {
									if (item.innerText.indexOf('营业执照') >= 0) {
										yyzz = 1;
									}
									if (item.innerText.indexOf('委托书') >= 0) {
										wts = 1;
									}
									if (item.innerText.indexOf('身份证') >= 0) {
										sfz = 1;
									}
								});
								if (yyzz == 0) {
									alert('附件名称中缺少营业执照!');
									return;
								}
								if (wts == 0) {
									alert('附件名称中缺少委托书!');
									return;
								}
								if (sfz == 0) {
									alert('附件名称中缺少身份证!');
									return;
								}
							} else {
							}
							$.ajax({
								type: "post",
								dataType: "json",
								url: 'supply/info/save',
								data: JSON.stringify(model),
								contentType: "application/json",
								success: function (data) {
									if (data.code == 60200) {
										if (action == '0') {
											saveAttch(model.infId, model, 'save');
										} else {
											saveAttch(model.infId, model, action == '0' ? 'save' : 'submit');
										}
									}
								},
								error: function (XMLHttpRequest, textStatus, errorThrown) {
									$.messager.alert('消息', errorThrown);
								}
							})
						}

						/**
						 * 提交的ajax
						 */
						function commitOrder(obj) {
							obj.infApprovalStatus = '1'
							$.ajax({
								type: "post",
								dataType: "json",
								url: 'supply/info/commit',
								data: JSON.stringify(obj),
								contentType: "application/json",
								success: function (data) {
									$.messager.alert('消息', data.msg);
									init();
								},
								error: function (XMLHttpRequest, textStatus, errorThrown) {
									$.messager.alert('消息', errorThrown);
								}
							})
						}

					</script>
					<script>
						function initCity(name) {
							$('#infCity').combogrid({
								// 				panelWidth : 100,
								url: 'sys/adress/selectComboxList?rows=100&page=1',
								queryParams: {
									q: name
								},
								idField: 'code',
								textField: 'name',
								mode: 'remote',
								required: true,
								fitColumns: true,
								columns: [[{
									field: 'name',
									title: '名称',
									width: 150
								}]]
							});
						}
						function initBank(name) {
							$('#infBankName').combogrid({
								// 				panelWidth : 100,
								url: 'sys/bank/selectComboxList?rows=100&page=1',
								queryParams: {
									q: name
								},
								idField: 'code',
								textField: 'name',
								mode: 'remote',
								required: true,
								fitColumns: true,
								columns: [[{
									field: 'name',
									title: '名称',
									width: 150
								}]]
							});
						}

						function saveBank() {
							var status = $('#infStatus').textbox('getValue');
							if (status == '审核中') {
								$.messager.alert('提示', '审核中不允许修改!');
								return;
							}
							var reg = /^[0-9]*$/;
							if (!reg.test($('#infBankNumber').textbox('getValue'))) {
								$.messager.alert('提示', '账号只能是数字!');
								return;
							}
							if (!checkComboGridValue('infBankName', 'code')) {
								$.messager.alert('提示', '请选择正确开户银行!');
								return;
							}

							if (!$('#fmBank').form('validate')) {
								$.messager.alert('提示', '请完成必填项输入!');
								return;
							}
							var model = {
								infId: PUser.infId,
								infName: PUser.inforName,
								bakCode: $('#infBankName').combogrid('getValue'),
								bakName: $('#infBankName').combogrid('getText'),
								bakOwnerName: $('#infBankAccount').textbox('getValue'),
								bakNum: $('#infBankNumber').textbox('getValue'),
								bakCountry: $('#infCountry').combobox('getValue'),
								status: '0'
							}
							$.ajax({
								type: "post",
								dataType: "json",
								url: 'supply/bank/save',
								data: JSON.stringify(model),
								contentType: "application/json",
								success: function (data) {
									$.messager.alert('消息', data.msg);
									if (data.code == 60200) {
										$('#ttBank').datagrid('appendRow', model);
									}
									$('#dlgBank').dialog('close');

								},
								error: function (XMLHttpRequest, textStatus, errorThrown) {
									$.messager.alert('消息', errorThrown);
								}
							})

						}

						function delBank(row) {
							$.ajax({
								type: "delete",
								dataType: "json",
								url: 'supply/bank/delete?bakCode=' + row.bakCode + "&infId=" + row.infId,

								contentType: "application/json",
								success: function (data) {
									$.messager.alert('消息', data.msg);
									if (data.code == 60200) {
										// init();
										var index = $('#ttBank').datagrid('getRowIndex', row);
										$('#ttBank').datagrid('deleteRow', index);
									}
									$('#dlgBank').dialog('close');

								},
								error: function (XMLHttpRequest, textStatus, errorThrown) {
									$.messager.alert('消息', errorThrown);
								}
							})

						}

						function bindgridBank() {
							$('#ttBank').datagrid(
								{
									title: '银行列表',
									queryParams: {
									},
									url: "supply/bank/selectList",
									iconCls: 'icon-application',
									width: 750,
									height: 400,
									nowrap: true,
									filterDelay: 0,
									rownumbers: true,
									animate: false,
									collapsible: false,
									clientPaging: false,
									remoteFilter: true,
									singleSelect: true,
									pagination: false,
									frozenColumns: [[]],
									columns: [[{
										field: 'bakName',
										title: '开户银行名称',
										width: 200,
										sortable: true,
										formatter: function (val, rec) {
											return val ? unescape(val) : '';
										}
									}, {
										field: 'bakOwnerName',
										title: '收款账户名称',
										width: 200,
										sortable: true,
										formatter: function (val, rec) {
											return val ? unescape(val) : '';
										}
									}, {
										field: 'bakNum',
										title: '收款账户号码',
										sortable: true,
										width: 150,
										formatter: function (val, rec) {
											return val ? unescape(val) : '';
										}
									}, {
										field: 'createTime',
										title: '创建时间',
										width: 120,
										sortable: true,
										formatter: function (val, rec) {
											return val ? unescape(val) : '';
										}
									},
									{
										field: 'updateTime',
										title: '修改时间',
										width: 120,
										sortable: true,
										formatter: function (val, rec) {
											return val ? unescape(val) : '';
										}
									}]],
									toolbar: [{
										text: '增加',
										iconCls: 'icon-add',
										handler: function () {
											$('#dlgBank').dialog('open').dialog('center').dialog('setTitle', '财务信息');
											$('#fmBank').form('clear');
										}
									},
										'-',
									{
										text: '编辑',
										iconCls: 'icon-edit',
										handler: function () {
											var row = $('#ttBank').datagrid('getSelected');
											if (row) {
												$('#dlgBank').dialog('open').dialog('center').dialog('setTitle', '银行信息');
												$('#infBankName').combogrid('setValue', row.bakCode);
												$('#infBankName').combogrid('setText', row.bakName);
												$('#infBankAccount').textbox('setValue', row.bakOwnerName);
												$('#infBankNumber').textbox('setValue', row.bakNum);
											}
										}
									},
										'-',
									{
										text: '删除',
										iconCls: 'icon-cancel',
										handler: function () {
											var row = $('#ttBank').datagrid(
												'getSelected');
											if (row) {
												$.messager.confirm('提示', '确定要删除这个吗?', function (r) {
													if (r) { delBank(row); }
												});
											} else {
												$.messager.alert('提示', '请选择一条数据')
											}
										}
									}],
									onLoadSuccess: function () {
									},
									onDblClickRow: function () {
										// editrow();
									}
								});
						} 
					</script>
					<script>

						function delSubject(row) {
							$.ajax({
								type: "delete",
								dataType: "json",
								url: 'supply/corp/delete?corpCode=' + row.corpCode + "&infId=" + row.infId,

								contentType: "application/json",
								success: function (data) {
									$.messager.alert('消息', data.msg);
									if (data.code == 60200) {
										// init();
										var index = $('#ttSubject').datagrid('getRowIndex', row);
										$('#ttSubject').datagrid('deleteRow', index);
									}
									$('#dlgSubject').dialog('close');

								},
								error: function (XMLHttpRequest, textStatus, errorThrown) {
									$.messager.alert('消息', errorThrown);
								}
							})

						}

						function saveSubject() {
							var status = $('#infStatus').textbox('getValue');
							if (status == '审核中') {
								$.messager.alert('提示', '审核中不允许修改!');
								return;
							}
							if (!$('#fmSubject').form('validate')) {
								alert('请完成必填项输入');
								return;
							}
							var model = {
								infId: PUser.infId,
								infName: PUser.inforName,
								corpCode: $('#cobCorp').combobox('getValue'),
								corpName: $('#cobCorp').combobox('getText'),
								subjectCode: $('#cobSubject').combobox('getValue'),
								subjectName: $('#cobSubject').combobox('getText'),
								status: '0'
							}
							$.ajax({
								type: "post",
								dataType: "json",
								url: 'supply/corp/save',
								data: JSON.stringify(model),
								contentType: "application/json",
								success: function (data) {
									$.messager.alert('消息', data.msg);
									if (data.code == 60200) {
										// init();
										$('#ttSubject').datagrid('appendRow', model);
									}
									$('#dlgSubject').dialog('close');

								},
								error: function (XMLHttpRequest, textStatus, errorThrown) {
									$.messager.alert('消息', errorThrown);
								}
							})

						}

						function bindgridSubject() {
							$('#ttSubject').datagrid(
								{
									title: '科目列表',
									queryParams: {
									},
									url: "supply/corp/selectList",
									iconCls: 'icon-application',
									width: 700,
									height: 400,
									nowrap: true,
									filterDelay: 0,
									rownumbers: true,
									animate: false,
									collapsible: false,
									clientPaging: false,
									remoteFilter: true,
									singleSelect: true,
									pagination: false,
									frozenColumns: [[]],
									columns: [[{
										field: 'corpCode',
										title: '公司代码',
										sortable: true,
										hidden: true,
										formatter: function (val, rec) {
											return val ? unescape(val) : '';
										}
									}, {
										field: 'corpName',
										title: '公司名称',
										sortable: true,
										width: 150,
										formatter: function (val, rec) {
											return val ? unescape(val) : '';
										}
									}, {
										field: 'subjectCode',
										title: '科目代码',
										sortable: true,
										hidden: true,
										formatter: function (val, rec) {
											return val ? unescape(val) : '';
										}
									}, {
										field: 'subjectName',
										title: '科目名称',
										sortable: true,
										width: 150,
										formatter: function (val, rec) {
											return val ? unescape(val) : '';
										}
										// }, {
										// 	field: 'bakOwnerName',
										// 	title: '所有人名称',
										// 	sortable: true,
										// 	formatter: function (val, rec) {
										// 		return val ? unescape(val) : '';
										// 	}
										// }, {
										// 	field: 'bakMode',
										// 	title: '付款方式',
										// 	sortable: true,
										// 	formatter: function (val, rec) {
										// 		return val ? unescape(val) : '';
										// 	}
										// }, {
										// 	field: 'bakModeName',
										// 	title: '付款方式描述',
										// 	sortable: true,
										// 	formatter: function (val, rec) {
										// 		return val ? unescape(val) : '';
										// 	}
									}, {
										field: 'createTime',
										title: '创建时间',
										width: 120,
										sortable: true,
										formatter: function (val, rec) {
											return val ? unescape(val) : '';
										}
									},
									{
										field: 'updateTime',
										title: '修改时间',
										width: 120,
										sortable: true,
										formatter: function (val, rec) {
											return val ? unescape(val) : '';
										}
									}]],
									toolbar: [{
										text: '增加',
										iconCls: 'icon-add',
										handler: function () {
											$('#dlgSubject').dialog('open').dialog('center').dialog('setTitle', '财务信息');
											$('#fmSubject').form('clear');
										}
									},
										'-',
									// {
									// 	text: '编辑',
									// 	iconCls: 'icon-edit',
									// 	handler: function () {
									// 		editSubject()
									// 	}
									// },
									// 	'-',
									{
										text: '删除',
										iconCls: 'icon-cancel',
										handler: function () {
											var row = $('#ttSubject').datagrid(
												'getSelected');
											if (row) {
												$.messager.confirm('提示', '确定要删除这个吗?', function (r) {
													if (r) { delSubject(row); }
												});
											} else {
												$.messager.alert('提示', '请选择一条数据')
											}
										}
									}],
									onLoadSuccess: function () {
									},
									onDblClickRow: function () {
										// editrow();
									}
								});
						} 
					</script>
					<style scoped="scoped">
						.textbox {
							height: 20px;
							margin: 0;
							padding: 0 2px;
							box-sizing: content-box;
						}

						/*.table tr {
        height: 15px;
    }*/
					</style>

					<form id="fm" class="ssec-form">
						<div class="easyui-tabs" id="tabs" style="width: 1000px; height: 450px"
							data-options="tools:'#tab-tools'">
							<div title="基本信息" style="padding: 5px;">
								<table class="table">
									<tr style="display: none;">
										<td>
											<div class="ssec-label">供应商id：</div>
										</td>
										<td>
											<div class="ssec-text normal">
												<input id="infId" name="infId" class="easyui-textbox" />
												<input id="oaStatus" name="oaStatus" class="easyui-textbox" />
												<input id="oaFlowId" name="oaFlowId" class="easyui-textbox" />
											</div>
										</td>
									</tr>
									<tr>
										<td>
											<div class="ssec-label">状态：</div>
										</td>
										<td>
											<div class="ssec-text normal">
												<input id="infStatus" name="infStatus" class="easyui-textbox"
													data-options="disabled:true" />
											</div>
										</td>
									</tr>
									<tr>
										<td>
											<div class="ssec-label">编码：</div>
										</td>
										<td>
											<div class="ssec-text normal">
												<input id="infCode" name="infCode" class="easyui-textbox"
													data-options="disabled:true" />
											</div>
										</td>
									</tr>
									<tr>
										<td>
											<div class="ssec-label">准入目录：</div>
										</td>
										<td>
											<div class="ssec-text normal">
												<input id="comAdmit" class="easyui-combotree"
													data-options="editable:false,required:true" style="width: 350px" />
											</div>
										</td>
									</tr>
									<tr>
										<td>
											<div class="ssec-label">名称：</div>
										</td>
										<td>
											<div class="ssec-text normal">
												<input id="infName" name="infName" class="easyui-textbox"
													data-options="disabled:true" style="width: 350px" />
											</div>
										</td>
									</tr>
									<!-- 			<tr> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-label">英文名称：</div> -->
									<!-- 				</td> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-text normal"> -->
									<!-- 						<input id="infNameEn" name="infNameEn" -->
									<!-- 							class="easyui-textbox" data-options="required:true" /> -->
									<!-- 					</div> -->
									<!-- 				</td> -->
									<!-- 			</tr> -->
									<!-- 			<tr> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-label">供应商类别：</div> -->
									<!-- 				</td> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-text normal"> -->
									<!-- 						<input id="infCatagory" name="infCatagory" -->
									<!-- 							class="easyui-textbox" data-options="required:true" /> -->
									<!-- 					</div> -->
									<!-- 				</td> -->
									<!-- 			</tr> -->
									<!-- 			<tr> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-label">企业性质：</div> -->
									<!-- 				</td> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-text normal"> -->
									<!-- 						<input id="infNature" name="infNature" -->
									<!-- 							class="easyui-textbox" data-options="required:true" /> -->
									<!-- 					</div> -->
									<!-- 				</td> -->
									<!-- 			</tr> -->
									<!-- 			<tr> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-label">供应商类型：</div> -->
									<!-- 				</td> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-text normal"> -->
									<!-- 						<input id="infType" name="infType" -->
									<!-- 							class="easyui-textbox" data-options="required:true" /> -->
									<!-- 					</div> -->
									<!-- 				</td> -->
									<!-- 			</tr> -->
									<!-- 			<tr> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-label">内部外部：</div> -->
									<!-- 				</td> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-text normal"> -->
									<!-- 						<input id="infIsInside" name="infIsInside" -->
									<!-- 							class="easyui-textbox" data-options="required:true" /> -->
									<!-- 					</div> -->
									<!-- 				</td> -->
									<!-- 			</tr> -->
									<tr>
										<td>
											<div class="ssec-label">社会信用代码：</div>
										</td>
										<td>
											<div class="ssec-text normal">
												<input id="infCreditCode" name="infCreditCode" class="easyui-textbox"
													required="true" data-options="" />
											</div>
										</td>
									</tr>
									<!-- 			<tr> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-label">注册资金：</div> -->
									<!-- 				</td> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-text normal"> -->
									<!-- 						<input id="infCapital" name="infCapital" -->
									<!-- 							class="easyui-textbox" data-options="required:true" /> -->
									<!-- 					</div> -->
									<!-- 				</td> -->
									<!-- 			</tr> -->
									<!-- 			<tr> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-label">币种：</div> -->
									<!-- 				</td> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-text normal"> -->
									<!-- 						<input id="infCurrency" name="infCurrency" class="easyui-textbox" -->
									<!-- 							data-options="required:true" /> -->
									<!-- 					</div> -->
									<!-- 				</td> -->
									<!-- 			</tr> -->
									<!-- 			<tr> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-label">纳税人：</div> -->
									<!-- 				</td> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-text normal"> -->
									<!-- 						<input id="infTaxpayer" name="infTaxpayer" class="easyui-textbox" -->
									<!-- 							data-options="required:true" /> -->
									<!-- 					</div> -->
									<!-- 				</td> -->
									<!-- 			</tr> -->
									<!-- 			<tr> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-label">是否施工队：</div> -->
									<!-- 				</td> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-text normal"> -->
									<!-- 						<input id="infIsConstruction" name="infIsConstruction" -->
									<!-- 							class="easyui-textbox" data-options="required:true" /> -->
									<!-- 					</div> -->
									<!-- 				</td> -->
									<!-- 			</tr> -->
									<!-- 			<tr> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-label">是否国外供应商：</div> -->
									<!-- 				</td> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-text normal"> -->
									<!-- 						<input id="infIsAbordSupply" name="infIsAbordSupply" -->
									<!-- 							class="easyui-textbox" data-options="required:true" /> -->
									<!-- 					</div> -->
									<!-- 				</td> -->
									<!-- 			</tr> -->
									<tr>
										<td>
											<div class="ssec-label">国家：</div>
										</td>
										<td>
											<div class="ssec-text normal">
												<input id="infCountry" name="infCountry" class="easyui-combobox"
													data-options="editable:false,required:true,url:'sysDict/queryItemByTypeName?dicName=国家',method:'get',
					                                                          valueField:'dicValue',textField:'dicName',panelHeight:'auto'" />

											</div>
										</td>
									</tr>
									<tr>
										<td>
											<div class="ssec-label">省份：</div>
										</td>
										<td>
											<div class="ssec-text normal">
												<input id="infProvince" name="infProvince" class="easyui-combobox"
													data-options="editable:false,required:true,url:'sysDict/queryItemByTypeName?dicName=地区',method:'get',
					                                                          valueField:'dicValue',textField:'dicName',panelHeight:'auto'" />

											</div>
										</td>
									</tr>
									<tr>
										<td>
											<div class="ssec-label">地市：</div>
										</td>
										<td>
											<div class="ssec-text normal">
												<input id="infCity" name="infCity" width="150" />
											</div>
										</td>
									</tr>

									<!-- 			<tr> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-label">邮政编码：</div> -->
									<!-- 				</td> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-text normal"> -->
									<!-- 						<input id="infPostal" name="infPostal" class="easyui-textbox" -->
									<!-- 							data-options="required:true" /> -->
									<!-- 					</div> -->
									<!-- 				</td> -->
									<!-- 			</tr> -->
									<tr>
										<td>
											<div class="ssec-label">邮箱：</div>
										</td>
										<td>
											<div class="ssec-text normal">
												<input id="infMail" name="infMail" class="easyui-textbox"
													data-options="required:true,validType:'email'" />
											</div>
										</td>
									</tr>
									<tr>
										<td>
											<div class="ssec-label">单位地址：</div>
										</td>
										<td>
											<div class="ssec-text normal">
												<input id="infAddress" name="infAddress" class="easyui-textbox"
													data-options="required:true" />
											</div>
										</td>
									</tr>
									<!-- 			<tr> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-label">电话：</div> -->
									<!-- 				</td> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-text normal"> -->
									<!-- 						<input id="infTelphone" name="infTelphone" class="easyui-textbox" -->
									<!-- 							data-options="required:true" /> -->
									<!-- 					</div> -->
									<!-- 				</td> -->
									<!-- 			</tr> -->
									<!-- 			<tr> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-label">企业网站：</div> -->
									<!-- 				</td> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-text normal"> -->
									<!-- 						<input id="infUrl" name="infUrl" class="easyui-textbox" -->
									<!-- 							data-options="required:true" /> -->
									<!-- 					</div> -->
									<!-- 				</td> -->
									<!-- 			</tr> -->

									<!-- 			<tr> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-label">传真：</div> -->
									<!-- 				</td> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-text normal"> -->
									<!-- 						<input id="infFax" name="infFax" class="easyui-textbox" -->
									<!-- 							data-options="required:true" /> -->
									<!-- 					</div> -->
									<!-- 				</td> -->
									<!-- 			</tr> -->

									<!-- 			<tr> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-label">身份证号：</div> -->
									<!-- 				</td> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-text normal"> -->
									<!-- 						<input id="infCard" name="infCard" class="easyui-textbox" -->
									<!-- 							data-options="required:true" /> -->
									<!-- 					</div> -->
									<!-- 				</td> -->
									<!-- 			</tr> -->
									<tr>
										<td>
											<div class="ssec-label">法定代表人：</div>
										</td>
										<td>
											<div class="ssec-text normal">
												<input id="infLegalPerson" name="infLegalPerson" class="easyui-textbox"
													data-options="required:true" />
											</div>
										</td>
									</tr>
									<tr>
										<td>
											<div class="ssec-label">手机：</div>
										</td>
										<td>
											<div class="ssec-text normal">
												<input id="infMobile" name="infMobile" class="easyui-textbox"
													data-options="required:true" />
											</div>
										</td>
									</tr>
									<tr>
										<td>
											<div class="ssec-label">联系人姓名：</div>
										</td>
										<td>
											<div class="ssec-text normal">
												<input id="infContactsName" name="infContactsName"
													class="easyui-textbox" data-options="required:true" />
											</div>
										</td>
									</tr>
									<!-- 			<tr> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-label">联系人身份证：</div> -->
									<!-- 				</td> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-text normal"> -->
									<!-- 						<input id="infContactsCard" name="infContactsCard" -->
									<!-- 							class="easyui-textbox" data-options="required:true" /> -->
									<!-- 					</div> -->
									<!-- 				</td> -->
									<!-- 			</tr> -->
									<!-- 			<tr> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-label">联系人座机：</div> -->
									<!-- 				</td> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-text normal"> -->
									<!-- 						<input id="infContacsTelphone" name="infContacsTelphone" -->
									<!-- 							class="easyui-textbox" data-options="required:true" /> -->
									<!-- 					</div> -->
									<!-- 				</td> -->
									<!-- 			</tr> -->
									<!-- 			<tr> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-label">联系人手机：</div> -->
									<!-- 				</td> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-text normal"> -->
									<!-- 						<input id="infContactsMobile" name="infContactsMobile" -->
									<!-- 							class="easyui-textbox" data-options="required:true" /> -->
									<!-- 					</div> -->
									<!-- 				</td> -->
									<!-- 			</tr> -->
									<!-- 			<tr> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-label">分行名称：</div> -->
									<!-- 				</td> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-text normal"> -->
									<!-- 						<input id="infBranchName" name="infBranchName" -->
									<!-- 							class="easyui-textbox" data-options="required:true" /> -->
									<!-- 					</div> -->
									<!-- 				</td> -->
									<!-- 			</tr> -->

									<tr>
										<td>
											<div class="ssec-label">税分类：</div>
										</td>
										<td>
											<div class="ssec-text normal">
												<input id="infTax" name="infTax" class="easyui-combobox"
													data-options="editable:false,required:true,url:'sysDict/queryItemByTypeName?dicName=税分类',method:'get',
					                                                          valueField:'dicValue',textField:'dicName',panelHeight:'auto'" />


											</div>
										</td>
									</tr>
									<tr>
										<td>
											<div class="ssec-label">语言：</div>
										</td>
										<td>
											<div class="ssec-text normal">
												<input id="infType" name="infType" class="easyui-combobox"
													data-options="editable:false,required:true,url:'sysDict/queryItemByTypeName?dicName=语言',method:'get',
					                                                          valueField:'dicValue',textField:'dicName',panelHeight:'auto'" />


											</div>
										</td>
									</tr>
									<tr>
										<td>
											<div class="ssec-label">付款条件：</div>
										</td>
										<td>
											<div class="ssec-text normal">
												<input id="cobCondition" name="cobCondition" class="easyui-combobox"
													data-options="editable:false,required:true,url:'sysDict/queryItemByTypeName?dicName=付款条件',method:'get',
					                                                          valueField:'dicValue',textField:'dicName',panelHeight:'auto'" />


											</div>
										</td>
									</tr>
									<!-- 			<tr> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-label">经营范围：</div> -->
									<!-- 				</td> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-text normal"> -->
									<!-- 						<input id="infRange" name="infRange" class="easyui-textbox" -->
									<!-- 							data-options="required:true" /> -->
									<!-- 					</div> -->
									<!-- 				</td> -->
									<!-- 			</tr> -->
									<tr>
										<td>
											<div class="ssec-label">新源员工HI账号(请和联系人咨询)：</div>
										</td>
										<td>
											<div class="ssec-text normal">
												<input id="infGroup" name="infGroup" class="easyui-textbox"
													data-options="required:true" />
											</div>
										</td>
									</tr>
									<tr>
										<td>
											<div class="ssec-label">相关说明：</div>
										</td>
										<td>
											<div class="ssec-text normal">
												<input id="infExplain" name="infExplain" class="easyui-textbox"
													data-options="multiline:true" style="height: 60px" />
											</div>
										</td>
									</tr>
									<!-- 			<tr> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-label">审批状态：</div> -->
									<!-- 				</td> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-text normal"> -->
									<!-- 						<input id="infApprovalStatus" name="infApprovalStatus" -->
									<!-- 							class="easyui-textbox" data-options="required:true" /> -->
									<!-- 					</div> -->
									<!-- 				</td> -->
									<!-- 			</tr> -->
									<!-- 			<tr> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-label">create_time：</div> -->
									<!-- 				</td> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-text normal"> -->
									<!-- 						<input id="createTime" name="createTime" class="easyui-textbox" -->
									<!-- 							data-options="required:true" /> -->
									<!-- 					</div> -->
									<!-- 				</td> -->
									<!-- 			</tr> -->
									<!-- 			<tr> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-label">create_name：</div> -->
									<!-- 				</td> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-text normal"> -->
									<!-- 						<input id="createName" name="createName" class="easyui-textbox" -->
									<!-- 							data-options="required:true" /> -->
									<!-- 					</div> -->
									<!-- 				</td> -->
									<!-- 			</tr> -->
									<!-- 			<tr> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-label">create_id：</div> -->
									<!-- 				</td> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-text normal"> -->
									<!-- 						<input id="createId" name="createId" class="easyui-textbox" -->
									<!-- 							data-options="required:true" /> -->
									<!-- 					</div> -->
									<!-- 				</td> -->
									<!-- 			</tr> -->
									<!-- 			<tr> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-label">修改人id：</div> -->
									<!-- 				</td> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-text normal"> -->
									<!-- 						<input id="updateId" name="updateId" class="easyui-textbox" -->
									<!-- 							data-options="required:true" /> -->
									<!-- 					</div> -->
									<!-- 				</td> -->
									<!-- 			</tr> -->
									<!-- 			<tr> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-label">修改人：</div> -->
									<!-- 				</td> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-text normal"> -->
									<!-- 						<input id="updateName" name="updateName" class="easyui-textbox" -->
									<!-- 							data-options="required:true" /> -->
									<!-- 					</div> -->
									<!-- 				</td> -->
									<!-- 			</tr> -->
									<!-- 			<tr> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-label">修改时间：</div> -->
									<!-- 				</td> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-text normal"> -->
									<!-- 						<input id="updateTime" name="updateTime" class="easyui-textbox" -->
									<!-- 							data-options="required:true" /> -->
									<!-- 					</div> -->
									<!-- 				</td> -->
									<!-- 			</tr> -->
									<!-- 			<tr> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-label">是否删除：</div> -->
									<!-- 				</td> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-text normal"> -->
									<!-- 						<input id="delFlag" name="delFlag" class="easyui-textbox" -->
									<!-- 							data-options="required:true" /> -->
									<!-- 					</div> -->
									<!-- 				</td> -->
									<!-- 			</tr> -->
									<!-- 			<tr> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-label">状态：</div> -->
									<!-- 				</td> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-text normal"> -->
									<!-- 						<input id="status" name="status" class="easyui-textbox" -->
									<!-- 							data-options="required:true" /> -->
									<!-- 					</div> -->
									<!-- 				</td> -->
									<!-- 			</tr> -->
									<!-- 			<tr> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-label">备注：</div> -->
									<!-- 				</td> -->
									<!-- 				<td> -->
									<!-- 					<div class="ssec-text normal"> -->
									<!-- 						<input id="remark" name="remark" class="easyui-textbox" -->
									<!-- 							data-options="required:true" /> -->
									<!-- 					</div> -->
									<!-- 				</td> -->
									<!-- 			</tr> -->
								</table>
							</div>
							<div title="银行信息">
								<div style="padding-left: 10px;padding-top: 10px;">
									<table id="ttBank"></table>
								</div>
							</div>
							<div title="经营范围">
								<div style="padding-left: 10px;padding-top: 10px;">
									<table id="ttSubject"></table>
								</div>
							</div>
							<div title="附件" style="padding: 5px;">
								<table>
									<tr>
										<td style="width: 180px;">
											<div>附件：</div>
											<div style="font-size: 10px;">
												(营业执照、授权委托书、法人身份证、资质证书、相关业绩、近三年财务状况)</div>
										</td>
										<td><input type="button" id="uploadbtn" value="选择文件..." /> <input type="file"
												id="uploadpicker" accept="" onchange="changeFile()" multiple
												style="display: none;" />
											<span>（文件名称不能包含斜杠、空格、&、#等特殊字符）</span>
										</td>
									</tr>
									<tr>
										<td>附件下载：</td>
										<td>
											<ul id="checkfileList"></ul>
										</td>
									</tr>
								</table>
							</div>
						</div>
						<div id="tab-tools">
							<a class="easyui-linkbutton" onclick="save('0');" id="btnSave" iconcls="icon-save">保存</a> <a
								class="easyui-linkbutton" onclick="commit('1');" id="btnCommit" iconcls="icon-ok">提交</a>
						</div>
					</form>
					<div id="dlgSubject" class="easyui-dialog" style="width:400px"
						data-options="closed:true,modal:true,border:'thin',buttons:'#dlg-buttonsSubject'">
						<form id="fmSubject" method="post" novalidate style="margin:0;padding:20px 50px">
							<table>
								<tr>
									<td>
										<span>选择公司:</span>
									</td>
									<td> <input id="cobCorp" style="width: 200px" class="easyui-combobox" data-options="url:'sysDict/queryItemByTypeName?dicName=交货工厂',method:'get',
																 valueField:'dicValue',textField:'dicName',panelHeight:'auto',required:true,editable:false,
																 onChange: function(newValue,oldValue){
																}"></td>
								</tr>
								<tr>
									<td>
										<span>选择经营范围:</span>
									</td>
									<td> <input id="cobSubject" style="width: 200px" class="easyui-combobox"
											data-options="url:'sysDict/queryItemByTypeName?dicName=科目',method:'get',
																 valueField:'dicValue',textField:'dicName',panelHeight:'auto',required:true,editable:false,
																 onChange: function(newValue,oldValue){
																}"></td>

								</tr>
							</table>
						</form>
					</div>
					<div id="dlg-buttonsSubject">
						<a href="javascript:void(0)" class="easyui-linkbutton c6" iconCls="icon-ok"
							onclick="saveSubject()" style="width:90px">保存</a>
						<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel"
							onclick="javascript:$('#dlgSubject').dialog('close')" style="width:90px">关闭</a>
					</div>

					<div id="dlgBank" class="easyui-dialog" style="width:700px"
						data-options="closed:true,modal:true,border:'thin',buttons:'#dlg-buttonsBank'">
						<form id="fmBank" method="post" novalidate style="margin:0;padding:20px 50px">
							<table>
								<tr>
									<td>
										<div class="ssec-label">开户银行名称：</div>
										<div style="font-size: 10px;">（支持关键字查询,%分割多个关键字,只显示前100条数据,如“%石家庄%东风%支行”）</div>
									</td>
									<td>
										<div class="ssec-text normal">
											<input id="infBankName" style="width: 280px"></input>
										</div>
									</td>
								</tr>
								<tr>
									<td>
										<div class="ssec-label">收款账户名称：</div>
									</td>
									<td>
										<div class="ssec-text normal">
											<input id="infBankAccount" name="infBankAccount" class="easyui-textbox"
												data-options="required:true" />
										</div>
									</td>
								</tr>
								<tr>
									<td>
										<div class="ssec-label">收款账户号码：</div>
									</td>
									<td>
										<div class="ssec-text normal">
											<input id="infBankNumber" name="infBankNumber" class="easyui-textbox"
												data-options="required:true" />
										</div>
									</td>
								</tr>
							</table>
						</form>
					</div>
					<div id="dlg-buttonsBank">
						<a href="javascript:void(0)" class="easyui-linkbutton c6" iconCls="icon-ok" onclick="saveBank()"
							style="width:90px">保存</a>
						<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel"
							onclick="javascript:$('#dlgBank').dialog('close')" style="width:90px">关闭</a>
					</div>

					<script type="text/javascript">
						var selectedFileList = [];//已选文件列表
						var succsessCount = 0;//上传成功文件个数
						var errorCount = 0;//上传失败文件个数
						/************文件处理部分*************/

						/**
						 * 保存附件
						 */

						function saveAttch(fileid, obj, action) {
							let saveNum = 0
							if (selectedFileList.length > 0) {
								$.each(selectedFileList, function (index, item) {
									showFilediv();
									var dataform = new FormData();
									dataform.append("file", item);
									var xmlhttp = null;
									if (window.XMLHttpRequest) { // code for all new browsers
										xmlhttp = new XMLHttpRequest();
									} else if (window.ActiveXObject) {// code for IE5 and IE6
										xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
									}
									if (xmlhttp != null) {
										xmlhttp.open("POST", "api/file/springUpload?fileRow="
											+ fileid + "&fileTable=supply_info&fileName="
											+ item.name, true);
										xmlhttp.setRequestHeader('token', localStorage
											.getItem('tokenSupply'));
										xmlhttp.setRequestHeader('userType', localStorage
											.getItem('userType'));
										xmlhttp.send(dataform);
										xmlhttp.onreadystatechange = callbackMethods;
									} else {
										alert("你的浏览器版本不兼容，请使用更高版本的浏览器");
									}

									function callbackMethods() {
										if (xmlhttp.readyState == 4) {
											if (xmlhttp.status == 200) {
												saveNum += 1
											}
											if (saveNum == selectedFileList.length) {
												hideFilediv();
												if ('submit' == action) {
													commitOrder(obj)
												} else {
													init();
													$.messager.alert('消息', '保存成功');
												}
											}
										} else {
											if (xmlhttp.status == 500) {
											}
										}
									}
								});
							} else {
								if ('submit' == action) {
									commitOrder(obj)
								} else {
									init();
									$.messager.alert('消息', '保存成功');
								}

							}
						}

						/**
						 *文件框改变事件
						 */
						function changeFile() {
							var files = $("#uploadpicker").prop("files");
							$
								.each(
									files,
									function (index, item) {
										let choiseFile = $("#checkfileList>li");
										if (choiseFile.length > 0) {//文件去重
											let count = 0;
											$.each(choiseFile, function (index1, item1) {
												if (item.name == item1.innerText) {
													count++;
												}
											});
											if (count == 0) {
												if (checkFileLength(item.size)) {
													if (item.name.includes('#') || item.name.includes('/') || item.name.includes('&') || item.name.includes('\\') || item.name.includes(' ')) {
														alert('文件名不能包含&、斜杠、反斜杠、空格等特殊字符！');
														return;
													}
													$("#checkfileList")
														.append(
															"<li class=\"fileinfo\">"
															+ item.name
															+ "<a style=\"display: none; color: red; margin-left: 10px;\" href=\"javascript:void(0)\" onclick=\"RemoveFile(this,'"
															+ item.name
															+ "')\">删除</a>"
															+ "</li>");
													selectedFileList.push(item);
													AddMoushover();
												}
											}
										} else {
											if (checkFileLength(item.size)) {
												if (item.name.includes('#') || item.name.includes('/') || item.name.includes('&') || item.name.includes('\\') || item.name.includes(' ')) {
													alert('文件名不能包含&、斜杠、反斜杠、空格等特殊字符！');
													return;
												}
												$("#checkfileList")
													.append(
														"<li class=\"fileinfo\">"
														+ item.name
														+ "<a style=\"display: none; color: red; margin-left: 10px;\" href=\"javascript:void(0)\" onclick=\"RemoveFile(this,'"
														+ item.name
														+ "')\">删除</a>"
														+ "</li>");
												selectedFileList.push(item);
												AddMoushover();
											}
										}
									});
						}

						/**
						 *    判断文件是否超过限制大小
						 * @param fileLen
						 * @returns {boolean}
						 */
						function checkFileLength(fileLen) {
							if (fileLen > 102400000) {
								$.messager.alert("提示", "上传文件大小不能超过100M", "error");
								return false;
							}
							return true;
						}

						/**
						 * //添加鼠标经过事件，鼠标划过时显示“删除”
						 * @constructor
						 */
						function AddMoushover() {
							$(".fileinfo").hover(function () {
								$(this).find("a").last().css("display", "");
							}, function () {
								$(this).find("a").last().css("display", "none");
							});
						}

						/**
						 *  移除已选择的文件
						 */

						function RemoveFile(obj, fileId) {
							$.messager.confirm("提示", "确认删除当前文件?", function (e) {
								if (e) {
									let index = $("#checkfileList>li").index($(obj).parent());
									selectedFileList.splice(index, 1);
									$(obj).parent().remove();

									$.ajax({
										type: "post",
										url: 'file/deleteFile?fileId=' + fileId,
										success: function (data) {
											$.messager.alert('消息', data);
										},
										error: function (XMLHttpRequest, textStatus,
											errorThrown) {
											$.messager.alert('消息', errorThrown);
										}
									});

								}
							});
						}

						/**
						 * 取得该条数据所属的文件列表
						 * @param row
						 */
						function getFileList(row) {
							$.ajax({
								type: "post",
								url: "file/getFileList",
								data: {
									fileTable: "supply_info",
									fileRow: row
								},
								success: function (data) {
									const dataArray = eval(data);
									initFile(dataArray);
								},
								error: function (XMLHttpRequest, textStatus, errorThrown) {
									$.messager.alert('消息', errorThrown);
								}
							});
						}

						/**
						 * 初始化该条数据的文件列表
						 * @param dataArray
						 */
						function initFile(dataArray) {
							$("#checkfileList").empty();
							// 			sselectedFileNameList = [];
							selectedFileList = [];
							dataArray
								.forEach(function (e, i, a) {
									$("#checkfileList")
										.append(
											"<li class=\"fileinfo\">"
											+ "<a style=\" color: blue; margin-left: 30px;\" href=\"javascript:void(0)\" onclick=\"downloadFile('"
											+ e.FILE_NAME
											+ "','"
											+ e.FILE_ID
											+ "')\">"
											+ e.FILE_NAME
											+ "</a>"
											+ "<a style=\"display: none; color: red; margin-left: 30px;\" href=\"javascript:void(0)\" onclick=\"RemoveFile(this,'"
											+ e.FILE_ID + "')\">删除</a>"
											+ "</li>");
									// 						sselectedFileNameList.push(e.FILE_NAME);
									AddMoushover();
								});
						}

						// 文件下载
						function downloadFile(fileName, fileRow) {
							let url = 'api/file/download?id=' + fileRow
							let xhr = new XMLHttpRequest()
							xhr.open('GET', url, true)
							xhr.setRequestHeader('token', localStorage.getItem('tokenSupply'));
							xhr.setRequestHeader('userType', localStorage.getItem('userType'));
							xhr.responseType = 'blob'
							xhr.onload = function (data) {
								if (this.status == 200) {
									let blob = this.response
									let reader = new FileReader()
									reader.readAsDataURL(blob)
									reader.onload = function (e) {
										let a = document.createElement('a')
										a.download = fileName
										a.href = e.target.result
										$('body').append(a)
										a.click()
										$(a).remove()
									}
								} else {

								}
							}
							xhr.send()
						}
					</script>

		</body>

		</html>